<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title>考试系统-我的成绩</title>
		<script type="text/javascript" src="/exam/js/public.js" ></script>
	</head>
	<body>
	    <div class="navigation-t">
	   	  <div class="navigation-tl">当前位置：<a href="#" onclick="changeMain('/exam/exam-home')">首页</a> > 我的成绩</div>
	    </div>
	    <div class="project">
	     <div class="project-padding" style="margin-top:10px"> 
           <div class="table-tool">
          	 <div class="table-tool-ser">
          	 	<div class="tool-ser"><input type="text" class="form-control" placeholder="输入试卷名称" id="search"/></div>
          	 	<div class="tool-btn" onClick="search2()"><span class="ser-icon"></span><a>搜索</a></div>
          	 </div>
           </div>
           <div class="table-head">
              <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
          		<thead>
	          		<tr>
	          			<td width="6%">序号</td>
	          			<td width="34%">试卷名称</td>
	          			<td width="20%">总分</td>
                        <td width="20%">考试成绩</td>
	          			<td width="20%">考试时间</td>
	          		</tr>
          		</thead>
          		<tbody>
	          		<tr th:each="collect,iterStat : ${results}">
			          	<td th:text="${iterStat.count}"></td>
			          	<td th:text="${collect.name}"></td>
	          			<td th:text="${collect.totalScore}">0</td>
			          	<td th:text="${collect.score}"></td>
	          			<td th:text="${collect.createDate}"></td>
	          		</tr>
	          	</tbody>
          	</table>
           </div>
           <!--分页开始-->
          <div class="multimedia-c">
	         <ul class="pagination" id="pagination"></ul>
	         <input type="hidden" id="PageCount" runat="server" />
	         <input type="hidden" id="PageSize" runat="server" value="5" />
	         <input type="hidden" id="countindex" runat="server" value="10"/>
	         <!--设置最多显示的页码数 可以手动设置 默认为7-->
	         <input type="hidden" id="visiblePages" runat="server" value="5" />
	      </div>
          <!--分页结束-->
          </div>
	    </div>
<script th:inline="javascript">  
/*<![CDATA[*/  
    var total ="[[${total}]]";
    var pageNo ="[[${pageNo}]]";
    var search=[[${search}]];
    $("#search").val(search);
    $("#PageCount").val(total);
    var stuName= $("#stuName").text();
    loadpage(pageNo);
    function search2(){
    	 var search= $("#search").val();
    	 $("#frameReft").load("/examReport/results.html",{'search': search});
    	}
    function loadpage(num) {
        var myPageCount = parseInt($("#PageCount").val());
        var myPageSize = parseInt($("#PageSize").val());
        var countindex = myPageCount % myPageSize > 0 ? (myPageCount / myPageSize) + 1 : (myPageCount / myPageSize);
        $("#countindex").val(countindex);
        $.jqPaginator('#pagination', {
            totalPages: parseInt($("#countindex").val()),
            visiblePages: parseInt($("#visiblePages").val()),
            currentPage : parseInt(num),
            first: '<li class="first"><a href="javascript:;">首页</a></li>',
            prev: '<li class="prev"><a href="javascript:;"><i class="arrow arrow2"></i>上一页</a></li>',
            next: '<li class="next"><a href="javascript:;">下一页<i class="arrow arrow3"></i></a></li>',
            last: '<li class="last"><a href="javascript:;">末页</a></li>',
            page: '<li class="page"><a href="javascript:;">{{page}}</a></li>',
            onPageChange: function (num, type) {
                if (type == "change") {
                	$("#frameReft").load("/examReport/results.html",{"pageNo":num,"pageSize":'5'});
                }
            }
        });
    }
/*]]>*/  
</script>
	</body>
</html>
